/**
 * 方式1
 * 列数据格式化方法命名规范
 * @cellVal 单元格值
 * @cellConfig 单元格配置
 * @rowData 当前行数据
 * 
 */
function averageFeeFormatter(cellVal,cellConfig,rowData){
//	alert("cellVal : "+$.objToJSONString(cellVal));
//	alert("cellConfig : "+$.objToJSONString(cellConfig));
//	alert("rowData : "+$.objToJSONString(rowData));
	if (parseInt(rowData.count) > 0) {
		return rowData.fee / rowData.count;
	}else{
		return 0;
	}
}

function studentTotalFormatter(cellVal,cellConfig,rowData){
	if(rowData.students){
		return rowData.students.length;
	}else{
		return 0;
	}
}


/**
 * 方式2(性能更好，推荐)
 * @param {Object} rowDatas
 * @param {Object} gridData
 */
function afterLoad4Clazz(rowDatas,gridData){
	for(var i=0;i<rowDatas.length;i++){
		//给grid上name为averageFee2赋值
		if (parseInt(rowDatas[i].count) > 0) {
			rowDatas[i].averageFee2 = rowDatas[i].fee / rowDatas[i].count;
		}else{
			rowDatas[i].averageFee2 = 0;
		}
	}
}


